<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>关键问题 - 1 - 修改状态</title>
  </head>

  <body>
    <script>
        //三种方式
        let p = new Promise((resolve, reject) => {
            //1. resolve
            resolve('ok'); // pending => fulfilled
            // 2. reject
            reject('error'); // pending => rejected
            //3. throw 
            // throw '有点问题~~~'; // pending => rejected
            console.log(123);
        });
        console.log(p);
    </script>
  </body>
</html>
